<html>
<head><meta charset="utf-8"><title>Depend on a binary? · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html">Depend on a binary?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218229508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218229508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218229508">(Nov 29 2020 at 20:42)</a>:</h4>
<p>I think I've seen this question a few times, but I don't remember the answer. I want depend on an in-tree project which is built as a binary (not a library). Is there a way to tell cargo 'run cargo build in this directory before building my project and give me the path to the output binary'? Or do I need to call <code>cargo build --output-format json</code> each time?</p>



<a name="218229776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218229776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218229776">(Nov 29 2020 at 20:49)</a>:</h4>
<p>Cargo has no concept of a project depending on a binary. If you want to make that a thing, we would be up for having someone start work on an RFC. There are previous discussions we can dig up for you.</p>



<a name="218229840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218229840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218229840">(Nov 29 2020 at 20:50)</a>:</h4>
<p>I would be happy to work on that :)</p>



<a name="218229843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218229843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218229843">(Nov 29 2020 at 20:50)</a>:</h4>
<p>I have some time over winter break</p>



<a name="218229886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218229886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218229886">(Nov 29 2020 at 20:52)</a>:</h4>
<p>naively, I'd expect something like this:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[dependencies]</span>
<span class="n">some_binary</span> <span class="o">=</span> <span class="s">"1.0"</span>
</code></pre></div>
<p>which tells cargo to</p>
<ol>
<li>run <code>cargo build</code> for that package</li>
<li>set <code>CARGO_BIN_SOME_BINARY</code> to the path to the generated executable</li>
</ol>



<a name="218229927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218229927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218229927">(Nov 29 2020 at 20:52)</a>:</h4>
<p>I'm sure there's lots of edge cases that go along with that, but that's the main idea</p>



<a name="218230132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230132">(Nov 29 2020 at 20:57)</a>:</h4>
<p>That is what I remember us discussing! I remember that there where corner cases, like what if that package has more than one binary. And inflammation details, it would be nice if you could run that binary from the command line in that project, but there is not cross platform / cross terminal way to add things to the path based on the working directory. But that is was a really promising approach. I think it was <span class="user-mention" data-user-id="239881">@Josh Triplett</span> that was most excited about it.</p>



<a name="218230189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230189">(Nov 29 2020 at 20:58)</a>:</h4>
<blockquote>
<p>what if that package has more than one binary</p>
</blockquote>
<p>error out and require the .toml file to specify which binary it means?</p>



<a name="218230202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230202">(Nov 29 2020 at 20:58)</a>:</h4>
<p>bikeshed: <code>some_binary = { version = "1.0", bin = "x" }</code></p>



<a name="218230215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230215">(Nov 29 2020 at 20:59)</a>:</h4>
<p>or if you want to avoid ambiguity between libraries and binaries, make <code>bin</code> unconditionally required</p>



<a name="218230288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230288">(Nov 29 2020 at 21:00)</a>:</h4>
<p>Right, all good options. Just complexity to think about.</p>



<a name="218230520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230520">(Nov 29 2020 at 21:06)</a>:</h4>
<p>Ideally, I'd have cargo supply the path to the directory containing all the built binaries.</p>



<a name="218230559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230559">(Nov 29 2020 at 21:06)</a>:</h4>
<p>Then you don't <em>have</em> to disambiguate.</p>



<a name="218230561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230561">(Nov 29 2020 at 21:06)</a>:</h4>
<p>And you can also put that directory into <code>$PATH</code> if you need to.</p>



<a name="218230566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230566">(Nov 29 2020 at 21:06)</a>:</h4>
<p>So, for instance, if you build a tool and then want to run a build system that will invoke that tool, you can.</p>



<a name="218230582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230582">(Nov 29 2020 at 21:07)</a>:</h4>
<p>We could, optionally, have a way to specify what subset of binaries you want (<code>bins = ["a", "b", ...]</code>), and then Cargo could just build those binaries and not the whole package.</p>



<a name="218230589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230589">(Nov 29 2020 at 21:07)</a>:</h4>
<p>But that's not required.</p>



<a name="218230590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230590">(Nov 29 2020 at 21:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218230520">said</a>:</p>
<blockquote>
<p>Ideally, I'd have cargo supply the path to the directory containing all the built binaries.</p>
</blockquote>
<p>that seems like it could lead to confusing errors if the project doesn't have the binary you expect</p>



<a name="218230603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230603">(Nov 29 2020 at 21:07)</a>:</h4>
<p>I think going for the most restrictive form and then loosening the requirements later would be a good approach</p>



<a name="218230610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230610">(Nov 29 2020 at 21:08)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> I think they'd be rather straightforward errors, like "file does not exist". Or, worst case, "couldn't find this binary in the path" or similar.</p>



<a name="218230658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230658">(Nov 29 2020 at 21:08)</a>:</h4>
<p>And I expect "build all of this crate's binaries" will be a not-uncommon case.</p>



<a name="218230687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230687">(Nov 29 2020 at 21:09)</a>:</h4>
<p>I <em>do</em>, however, think we will need from the start a way to disambiguate between a library and binary crate with the same name.</p>



<a name="218230699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230699">(Nov 29 2020 at 21:09)</a>:</h4>
<p>And if we have such a mechanism, we should probably always use it, because that way an older cargo will know "hey, I don't know this, <em>splat</em>".</p>



<a name="218230758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230758">(Nov 29 2020 at 21:10)</a>:</h4>
<p>We should also have a mechanism for specifying the target, though that may be a challenge and we might not do it in the very first version of this feature.</p>



<a name="218230786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230786">(Nov 29 2020 at 21:11)</a>:</h4>
<p>There's also the question of what type of dependency.</p>



<a name="218230792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230792">(Nov 29 2020 at 21:11)</a>:</h4>
<p>You should be able to do this in <code>[build-dependencies]</code>, and you get an environment variable set for <code>build.rs</code> so you can find and use it.</p>



<a name="218230846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230846">(Nov 29 2020 at 21:12)</a>:</h4>
<p>I thought build-dependencies are only available to the <code>build.rs</code> file?</p>



<a name="218230852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230852">(Nov 29 2020 at 21:13)</a>:</h4>
<p>for context, I want this so that rustdoc can run the <code>compiletest</code> binary in tests</p>



<a name="218230856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230856">(Nov 29 2020 at 21:13)</a>:</h4>
<p>I'm saying you should be able to have this in multiple kinds of dependencies.</p>



<a name="218230860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230860">(Nov 29 2020 at 21:13)</a>:</h4>
<p>If you depend on a binary in your <code>[build-dependencies]</code>, you would indeed only get to use it in <code>build.rs</code>, and also, it'd be built for the host.</p>



<a name="218230906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230906">(Nov 29 2020 at 21:14)</a>:</h4>
<p>ahhh because cargo needs to worry about cross-compiling, right</p>



<a name="218230910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230910">(Nov 29 2020 at 21:14)</a>:</h4>
<p>Among other reasons, yeah.</p>



<a name="218230911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230911">(Nov 29 2020 at 21:14)</a>:</h4>
<p>so for dev-dependencies it would be built for the target?</p>



<a name="218230918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230918">(Nov 29 2020 at 21:14)</a>:</h4>
<p>And for regular dependencies, yes.</p>



<a name="218230926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230926">(Nov 29 2020 at 21:15)</a>:</h4>
<p>All of this could be overridden with a <code>target = "..."</code> directive in the dependency, but these would be the defaults.</p>



<a name="218230933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230933">(Nov 29 2020 at 21:15)</a>:</h4>
<p>(so, you could also do things like "I need xyz, built for <code>wasm32-wasi</code>".)</p>



<a name="218230947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218230947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218230947">(Nov 29 2020 at 21:15)</a>:</h4>
<p><code>[build-dependencies]</code> seems like the easy case: build it for the host, hand <code>build.rs</code> a path to it via the environment, done.</p>



<a name="218231024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231024">(Nov 29 2020 at 21:17)</a>:</h4>
<p>If you have a binary in your <code>[dependencies]</code> or <code>[dev-dependencies]</code>, we build it for the target. We could supply the path via an environment variable to rustc, and let you just do things like <code>include_bytes!(env!(...))</code>.</p>



<a name="218231036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231036">(Nov 29 2020 at 21:17)</a>:</h4>
<p>wait, like include another binary in your binary? <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218231037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231037">(Nov 29 2020 at 21:17)</a>:</h4>
<p>that's <em>exciting</em></p>



<a name="218231050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231050">(Nov 29 2020 at 21:18)</a>:</h4>
<p>Yes, absolutely. Perhaps you're an installer, or perhaps you need a copy of a wasm binary at runtime...</p>



<a name="218231084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231084">(Nov 29 2020 at 21:18)</a>:</h4>
<p>I guess it follows though, you don't need any more tools than the path to the binary</p>



<a name="218231091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231091">(Nov 29 2020 at 21:18)</a>:</h4>
<p>This should, by the way, also work for things like <code>cdylib</code>.</p>



<a name="218231097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231097">(Nov 29 2020 at 21:18)</a>:</h4>
<p>hmm? what do dynamic libraries have to do with this?</p>



<a name="218231101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231101">(Nov 29 2020 at 21:19)</a>:</h4>
<p>Perhaps you're a program that wants to run something using LD_PRELOAD. Or perhaps you're a kernel building the equivalent of the VDSO.</p>



<a name="218231113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231113">(Nov 29 2020 at 21:19)</a>:</h4>
<p>You should be able to get the path to the .so or .dll you asked for.</p>



<a name="218231124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231124">(Nov 29 2020 at 21:20)</a>:</h4>
<p>so your idea is that a package should be able to depend on <em>arbitrary</em> build artifacts from another package?</p>



<a name="218231125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231125">(Nov 29 2020 at 21:20)</a>:</h4>
<p>(For that one, I think you <em>would</em> want to have an environment variable for the specific binary, not just the path.)</p>



<a name="218231184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231184">(Nov 29 2020 at 21:21)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Not "arbitrary", but bin or cdylib or staticlib, yes.</p>



<a name="218231260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231260">(Nov 29 2020 at 21:22)</a>:</h4>
<p>what makes those different from <code>dylib</code>?</p>



<a name="218231273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231273">(Nov 29 2020 at 21:23)</a>:</h4>
<p>They produce artifacts whose interface we define.</p>



<a name="218231280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231280">(Nov 29 2020 at 21:23)</a>:</h4>
<p>I guess my question is why you'd need the <em>path</em> to cydlib/staticlib dependencies instead of cargo providing them to the crate at build time</p>



<a name="218231285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231285">(Nov 29 2020 at 21:23)</a>:</h4>
<p>oh I guess you answered that already: <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218231101">https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218231101</a></p>



<a name="218231288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231288">(Nov 29 2020 at 21:23)</a>:</h4>
<p>dylib and rlib and proc-macro build things we don't define the interface to; we only say that you can use them with Rust, with no defined ABI.</p>



<a name="218231338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231338">(Nov 29 2020 at 21:24)</a>:</h4>
<p>ok, I see - you should be able to get the path to anything with a stable ABI</p>



<a name="218231349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231349">(Nov 29 2020 at 21:24)</a>:</h4>
<p>Exactly. We <em>might</em> want to expand that in the future, such as if you might be invoking rustc yourself somehow, but let's not do it from the start.</p>



<a name="218231357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231357">(Nov 29 2020 at 21:24)</a>:</h4>
<p>cdylib builds a C-compatible shared library, staticlib builds a C-compatible static library, and bin builds a binary that can run on the target. All of those are reasonable to want the artifacts from.</p>



<a name="218231377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231377">(Nov 29 2020 at 21:25)</a>:</h4>
<p>Ideally at some point we also support having such crates supply arbitrary additional files, not just the compiled artifact; for instance, a bin might have an accompanying data file or shell script or similar. But that can come later, and it's broader than just dependencies.</p>



<a name="218231378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231378">(Nov 29 2020 at 21:26)</a>:</h4>
<p>So let's keep it focused.</p>



<a name="218231424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231424">(Nov 29 2020 at 21:26)</a>:</h4>
<p>originally I just wanted binaries :P</p>



<a name="218231429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231429">(Nov 29 2020 at 21:26)</a>:</h4>
<p>Something like this:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[build-dependencies]</span>
<span class="n">some-binary-crate</span> <span class="o">=</span> <span class="p">{</span> <span class="n">version</span> <span class="o">=</span> <span class="s">"1.2.3"</span><span class="p">,</span> <span class="n">type</span><span class="o">=</span><span class="s">"bin"</span> <span class="p">}</span>
<span class="n">some-cdylib-crate</span> <span class="o">=</span> <span class="p">{</span> <span class="n">version</span> <span class="o">=</span> <span class="s">"4.5.6"</span><span class="p">,</span> <span class="n">type</span><span class="o">=</span><span class="s">"cdylib"</span> <span class="p">}</span>
</code></pre></div>



<a name="218231437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231437">(Nov 29 2020 at 21:27)</a>:</h4>
<p><em>Optionally</em> also <code>bins = ["x", "y", "z"]</code> on the binary crate.</p>



<a name="218231440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231440">(Nov 29 2020 at 21:27)</a>:</h4>
<p>and have <code>type="lib"</code> be a synonym for the current behavior, maybe</p>



<a name="218231442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231442">(Nov 29 2020 at 21:27)</a>:</h4>
<p>Sure, no objection there.</p>



<a name="218231445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231445">(Nov 29 2020 at 21:27)</a>:</h4>
<p>Makes sense.</p>



<a name="218231484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231484">(Nov 29 2020 at 21:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218231437">said</a>:</p>
<blockquote>
<p><em>Optionally</em> also <code>bins = ["x", "y", "z"]</code> on the binary crate.</p>
</blockquote>
<p>I definitely think we should have this, there should least be <em>a</em> way to tell cargo not to build more than necessary</p>



<a name="218231500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231500">(Nov 29 2020 at 21:28)</a>:</h4>
<p>I meant that it's optional in the toml.</p>



<a name="218231503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231503">(Nov 29 2020 at 21:28)</a>:</h4>
<p>(And also, that it's optional in the initial implementation.)</p>



<a name="218231510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231510">(Nov 29 2020 at 21:28)</a>:</h4>
<p>You should be able to ask for "everything", or some subset. You shouldn't <em>have</em> to list a specific set of binaries.</p>



<a name="218231583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231583">(Nov 29 2020 at 21:30)</a>:</h4>
<p>and this would behave ~the same as normal dependencies do, right? <code>dev-dependencies</code> would get the env variable set for tests/examples, <code>dependencies</code> would have it set for the main binary, <code>build-dependencies</code> would get it set for <a href="http://build.rs">build.rs</a></p>



<a name="218231616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231616">(Nov 29 2020 at 21:31)</a>:</h4>
<p>also, since we've expanded this to multiple types of artifacts, I think cargo should definitely set one env variable at a time, otherwise you'll get people trying to second-guess cargo's naming and possibly locking it into the current hash or something like that</p>



<a name="218231617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231617">(Nov 29 2020 at 21:31)</a>:</h4>
<p>With that in <code>build-dependencies</code>, you'd get <code>CARGO_BIN_DIR_SOME_BINARY_CRATE</code> in the environment in your <code>build.rs</code>, and <code>CARGO_CDYLIB_DIR_SOME_CDYLIB_CRATE</code>, and perhaps also <code>CARGO_BIN_FILE_SOME_BINARY_CRATE_x</code> for binary <code>x</code>, and <code>CARGO_CDYLIB_FILE_SOME_CDYLIB_CRATE_lib</code> (handwave on suffix, want to be forward-compatible with being able to build multiple cdylibs) pointing to <code>libsomething.so</code>.</p>



<a name="218231643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231643">(Nov 29 2020 at 21:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218231616">said</a>:</p>
<blockquote>
<p>also, since we've expanded this to multiple types of artifacts, I think cargo should definitely set one env variable at a time, otherwise you'll get people trying to second-guess cargo's naming and possibly locking it into the current hash or something like that</p>
</blockquote>
<p>Good point, I forgot that cdylib doesn't build something with a stable name. :(</p>



<a name="218231648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231648">(Nov 29 2020 at 21:31)</a>:</h4>
<blockquote>
<p>want to be forward-compatible with being able to build multiple cdylibs</p>
</blockquote>
<p>I thought cdylibs were like libs in that you can only have one? is there another parallel RFC?</p>



<a name="218231695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231695">(Nov 29 2020 at 21:32)</a>:</h4>
<p>"forward-compatible", as in "this is another thing I hope we fix someday and until then I don't want to lock us into making it harder to fix it".</p>



<a name="218231733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231733">(Nov 29 2020 at 21:33)</a>:</h4>
<p>It's fine if the environment variable is for the one cdylib built by a crate, as long as it's obvious where we could compatibly insert an additional token without a name clash.</p>



<a name="218231787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231787">(Nov 29 2020 at 21:34)</a>:</h4>
<p>Hang on, I just checked...</p>



<a name="218231790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231790">(Nov 29 2020 at 21:35)</a>:</h4>
<p>If you build a <code>cdylib</code>, there's no hash in the name.</p>



<a name="218231797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231797">(Nov 29 2020 at 21:35)</a>:</h4>
<p>You just get <code>libcratename.so</code>.</p>



<a name="218231800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231800">(Nov 29 2020 at 21:35)</a>:</h4>
<p>(or something else if you give it a different name, which I think you can do)</p>



<a name="218231804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231804">(Nov 29 2020 at 21:35)</a>:</h4>
<p>oh nice :) same for staticlibs?</p>



<a name="218231848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231848">(Nov 29 2020 at 21:36)</a>:</h4>
<p>Just confirmed that if you set <code>name = "bar"</code>, you get <code>libbar.so</code>.</p>



<a name="218231850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231850">(Nov 29 2020 at 21:36)</a>:</h4>
<p>Checking...</p>



<a name="218231854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231854">(Nov 29 2020 at 21:36)</a>:</h4>
<p>Yup, <code>libbar.a</code>.</p>



<a name="218231861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231861">(Nov 29 2020 at 21:37)</a>:</h4>
<p>ok, maybe it does make sense to only set the directory then</p>



<a name="218231868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231868">(Nov 29 2020 at 21:37)</a>:</h4>
<p>that naturally allows adding multiple cdylibs, too</p>



<a name="218231870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231870">(Nov 29 2020 at 21:37)</a>:</h4>
<p>There <em>is</em> value in having both the dir and the file supplied for you.</p>



<a name="218231884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231884">(Nov 29 2020 at 21:38)</a>:</h4>
<p>Having only the dir means you have to know whether <code>bar</code> becomes <code>libbar.so</code> or <code>bar.dll</code> or <code>libbar.dylib</code>.</p>



<a name="218231922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231922">(Nov 29 2020 at 21:38)</a>:</h4>
<p>Or in the case of a binary, whether it's <code>bar</code> or <code>bar.exe</code>.</p>



<a name="218231935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231935">(Nov 29 2020 at 21:38)</a>:</h4>
<p>I feel pretty strongly we should only set one or the other</p>



<a name="218231940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231940">(Nov 29 2020 at 21:38)</a>:</h4>
<p>we can always add the other later if we really need to</p>



<a name="218231945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231945">(Nov 29 2020 at 21:39)</a>:</h4>
<p>Why? I think there's useful value provided by both.</p>



<a name="218231948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231948">(Nov 29 2020 at 21:39)</a>:</h4>
<p>it's redundant information</p>



<a name="218231955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231955">(Nov 29 2020 at 21:39)</a>:</h4>
<p>you can get the directory from the binary and vice versa</p>



<a name="218231961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218231961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218231961">(Nov 29 2020 at 21:39)</a>:</h4>
<p>I wouldn't object to setting only the directory, and then people will need a function (probably supplied by a crate) to map names.</p>



<a name="218232027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232027">(Nov 29 2020 at 21:40)</a>:</h4>
<blockquote>
<p>probably supplied by a crate</p>
</blockquote>
<p>well, you can't use crates for <code>env!</code> macros, unless it were a proc-macro maybe</p>



<a name="218232032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232032">(Nov 29 2020 at 21:40)</a>:</h4>
<p>but it would definitely make sense for build scripts and tests</p>



<a name="218232034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232034">(Nov 29 2020 at 21:40)</a>:</h4>
<p>So, that brings us back to a different issue...</p>



<a name="218232047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232047">(Nov 29 2020 at 21:41)</a>:</h4>
<p>We might need a way to specify targets, as well as some aliases to let you say <code>target = "host"</code> or <code>target = "target"</code>.</p>



<a name="218232061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232061">(Nov 29 2020 at 21:41)</a>:</h4>
<p>Suppose you want a binary built for the target, and you want to do things to it that you don't want to have to pull in via proc macro or handle via const eval.</p>



<a name="218232109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232109">(Nov 29 2020 at 21:42)</a>:</h4>
<p>these are pretty far-off in the future <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218232112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232112">(Nov 29 2020 at 21:42)</a>:</h4>
<p>/me shakes his head...</p>



<a name="218232116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232116">(Nov 29 2020 at 21:42)</a>:</h4>
<p>maybe it makes sense to have the basic format and then we can add these later?</p>



<a name="218232118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232118">(Nov 29 2020 at 21:42)</a>:</h4>
<p>There's a specific issue.</p>



<a name="218232127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232127">(Nov 29 2020 at 21:42)</a>:</h4>
<p>If you're pulling in a binary, if you want to do <em>anything</em> more complex with it than just embed it, you probably want to run Rust code to do that.</p>



<a name="218232132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232132">(Nov 29 2020 at 21:43)</a>:</h4>
<p>The easiest place to do that is in <code>build.rs</code>.</p>



<a name="218232140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232140">(Nov 29 2020 at 21:43)</a>:</h4>
<p>I can see two ways we could handle that.</p>



<a name="218232145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232145">(Nov 29 2020 at 21:43)</a>:</h4>
<p>One would be to let you write it in <code>[dependencies]</code>, but then supply information about it to <code>build.rs</code>, like we do for <code>-sys</code> crates.</p>



<a name="218232190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232190">(Nov 29 2020 at 21:44)</a>:</h4>
<p>That would mean we're building the <code>[dependencies]</code> even for <code>build.rs</code>, but we already support that in some cases I believe.</p>



<a name="218232193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232193">(Nov 29 2020 at 21:44)</a>:</h4>
<p>you <em>do</em>?</p>



<a name="218232197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232197">(Nov 29 2020 at 21:44)</a>:</h4>
<p>that's really strange to me, I'd only expect <a href="http://build.rs">build.rs</a> to see things in build-dependencies</p>



<a name="218232210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232210">(Nov 29 2020 at 21:45)</a>:</h4>
<p>You can't actually use library crates from <code>[dependencies]</code> directly in your build script; you can't, for instance, <code>use foo::bar</code> if <code>foo</code> is in <code>[dependencies]</code>.</p>



<a name="218232211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232211">(Nov 29 2020 at 21:45)</a>:</h4>
<p>But you <em>can</em> get information about them.</p>



<a name="218232217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232217">(Nov 29 2020 at 21:45)</a>:</h4>
<p>One moment...</p>



<a name="218232223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232223">(Nov 29 2020 at 21:45)</a>:</h4>
<p><a href="https://doc.rust-lang.org/cargo/reference/build-script-examples.html?highlight=build.rs#using-another-sys-crate">https://doc.rust-lang.org/cargo/reference/build-script-examples.html?highlight=build.rs#using-another-sys-crate</a></p>



<a name="218232231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232231">(Nov 29 2020 at 21:45)</a>:</h4>
<p>Notice that <code>libz-sys</code> is in <code>[dependencies]</code>, but <code>build.rs</code> gets <code>DEP_Z_INCLUDE</code> set.</p>



<a name="218232274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232274">(Nov 29 2020 at 21:46)</a>:</h4>
<p>oh boy <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218232277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232277">(Nov 29 2020 at 21:46)</a>:</h4>
<p>and the other alternative?</p>



<a name="218232304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232304">(Nov 29 2020 at 21:47)</a>:</h4>
<p>The other alternative is that if you want a binary in your <a href="http://build.rs">build.rs</a> script, but you want it built for the target rather than the host, you write:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[build-dependencies]</span>
<span class="n">foo</span> <span class="o">=</span> <span class="p">{</span> <span class="n">version</span> <span class="o">=</span> <span class="s">"1.2.3"</span><span class="p">,</span> <span class="n">type</span> <span class="o">=</span> <span class="s">"bin"</span><span class="p">,</span> <span class="n">target</span> <span class="o">=</span> <span class="s">"target"</span> <span class="p">}</span>
</code></pre></div>



<a name="218232309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232309">(Nov 29 2020 at 21:47)</a>:</h4>
<p>I like that a lot better</p>



<a name="218232314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232314">(Nov 29 2020 at 21:47)</a>:</h4>
<p>it seems less 'magic'</p>



<a name="218232321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232321">(Nov 29 2020 at 21:47)</a>:</h4>
<p><code>"target"</code> here isn't a placeholder, it's the way of specifying "build for the target" (as opposed to <code>target = "host"</code>, which would be the default for <code>[build-dependencies]</code> but not for <code>[dependencies]</code>).</p>



<a name="218232368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232368">(Nov 29 2020 at 21:48)</a>:</h4>
<p>It's less magic, but also less consistent with how we handle <code>-sys</code> crates.</p>



<a name="218232386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232386">(Nov 29 2020 at 21:48)</a>:</h4>
<p>I'm not sure why you see this as analogous to -sys crates</p>



<a name="218232395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232395">(Nov 29 2020 at 21:49)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116015">@Alex Crichton</span> , who is probably the most knowledgeable about the -sys crate handling.</p>



<a name="218232399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232399">(Nov 29 2020 at 21:49)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Because that's the other case where we currently let you get access to artifacts built by one of your dependencies.</p>



<a name="218232404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232404">(Nov 29 2020 at 21:49)</a>:</h4>
<p>Including not just libraries, but header files or anything else you want.</p>



<a name="218232407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232407">(Nov 29 2020 at 21:49)</a>:</h4>
<p>ahhh, ok</p>



<a name="218232460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232460">(Nov 29 2020 at 21:50)</a>:</h4>
<p>That's part of the motivation for wanting "additional files" eventually. You <em>should</em> be able, in a <code>cdylib</code>, to supply not just a <code>.so</code> but also a directory of header files.</p>



<a name="218232468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232468">(Nov 29 2020 at 21:50)</a>:</h4>
<p>this is a lot more ambitious than I was originally <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218232475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232475">(Nov 29 2020 at 21:50)</a>:</h4>
<p>maybe you should write the RFC :P</p>



<a name="218232483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232483">(Nov 29 2020 at 21:51)</a>:</h4>
<p>I don't mind deferring the vast majority of this; I'm primarily bringing it up for forward-compatibility.</p>



<a name="218232486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232486">(Nov 29 2020 at 21:51)</a>:</h4>
<p>Maybe <em>we</em> could write the RFC? ;)</p>



<a name="218232546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232546">(Nov 29 2020 at 21:52)</a>:</h4>
<p><a href="/user_uploads/4715/WCKxm344QQ-FdS9srIxekvbe/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/WCKxm344QQ-FdS9srIxekvbe/image.png" title="image.png"><img src="/user_uploads/4715/WCKxm344QQ-FdS9srIxekvbe/image.png"></a></div>



<a name="218232589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232589">(Nov 29 2020 at 21:53)</a>:</h4>
<p>I think the <em>minimal</em> solution here just includes:</p>
<ul>
<li>The <code>type</code> field for dependencies, with support for <code>"bin"</code>, <code>"cdylib"</code>, <code>"staticlib"</code></li>
<li>Allow this in <code>[build-dependencies]</code>, <code>[dev-dependencies]</code>, and <code>[dependencies]</code>. The first defaults to host, the second and third default to target.</li>
<li>Define exactly which environment variables we export to which processes in each case, including the name transformations that happen to crate names (but not to binary names, I think; there's a recent RFC we can reference for that).</li>
<li>Either define a mechanism like <code>DEP_...</code> to handle <code>[dependencies]</code> in <code>build.rs</code>, <em>or</em> define <code>target</code> (which we know we'll want eventually anyway).</li>
</ul>



<a name="218232643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232643">(Nov 29 2020 at 21:54)</a>:</h4>
<p>Oh, also:</p>
<ul>
<li>Define whether cargo unifies the dependency tree with your dependencies (always, never, or give you the option?)</li>
</ul>



<a name="218232645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232645">(Nov 29 2020 at 21:54)</a>:</h4>
<p>I think the most minimal solution could even punt on <code>DEP_</code>/<code>target</code></p>



<a name="218232650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232650">(Nov 29 2020 at 21:55)</a>:</h4>
<p>and hard-code the defaults for now</p>



<a name="218232656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232656">(Nov 29 2020 at 21:55)</a>:</h4>
<p>I'd like to spec it, even if the initial implementation defers that.</p>



<a name="218232662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232662">(Nov 29 2020 at 21:55)</a>:</h4>
<p>All of this would live behind a <code>-Z bindeps</code> or similar, for now, until stabilized.</p>



<a name="218232666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232666">(Nov 29 2020 at 21:55)</a>:</h4>
<p>seems reasonable</p>



<a name="218232725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232725">(Nov 29 2020 at 21:56)</a>:</h4>
<p>I think I did good by pinging Josh instead of trying to remember any of this :-P</p>



<a name="218232731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232731">(Nov 29 2020 at 21:57)</a>:</h4>
<p>For reference, previous places this was discussed:</p>
<ul>
<li><a href="https://github.com/rust-lang/cargo/issues/4316">https://github.com/rust-lang/cargo/issues/4316</a></li>
<li><a href="https://github.com/rust-lang/cargo/pull/7804">https://github.com/rust-lang/cargo/pull/7804</a></li>
</ul>



<a name="218232749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232749">(Nov 29 2020 at 21:57)</a>:</h4>
<p>I personally do have a need for this, and would be very happy to see someone willing to work on it. I'm happy to help write the RFC.</p>



<a name="218232757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232757">(Nov 29 2020 at 21:57)</a>:</h4>
<p>sure, I can help with that :)</p>



<a name="218232799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232799">(Nov 29 2020 at 21:58)</a>:</h4>
<p>I'm more comfortable with implementation than with specs so it's a good fit :)</p>



<a name="218232809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232809">(Nov 29 2020 at 21:58)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="319062">@Nathaniel McCallum</span> as well, in case he'd started working on an RFC in this area.</p>



<a name="218232846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232846">(Nov 29 2020 at 21:59)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Among other potential uses for this, imagine if the <code>cmake</code> crate had the option to <em>build</em> cmake from source for you, in case it wasn't installed.</p>



<a name="218232892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232892">(Nov 29 2020 at 22:00)</a>:</h4>
<p>Insert rejoicing of Windows users here.</p>



<a name="218232900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218232900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218232900">(Nov 29 2020 at 22:00)</a>:</h4>
<p>this is all much more impressive than my original use case of "I don't want to have to define a stable API for compiletest" <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218233706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233706">(Nov 29 2020 at 22:21)</a>:</h4>
<p>Could you start a hackmd containing the normal RFC template?</p>



<a name="218233745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233745">(Nov 29 2020 at 22:22)</a>:</h4>
<p>give me 5 minutes, yes</p>



<a name="218233827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233827">(Nov 29 2020 at 22:25)</a>:</h4>
<p><a href="https://hackmd.io/@jynelson/H1waJo-oD/edit">https://hackmd.io/@jynelson/H1waJo-oD/edit</a></p>



<a name="218233935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233935">(Nov 29 2020 at 22:28)</a>:</h4>
<p>Oh, interesting! For that use case, would you want to depend on <em>yourself</em>?</p>



<a name="218233939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233939">(Nov 29 2020 at 22:28)</a>:</h4>
<p>right</p>



<a name="218233942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233942">(Nov 29 2020 at 22:28)</a>:</h4>
<p>or more accurately, dev-dependencies would depend on <code>bin</code></p>



<a name="218233944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233944">(Nov 29 2020 at 22:28)</a>:</h4>
<p>Right.</p>



<a name="218233947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233947">(Nov 29 2020 at 22:29)</a>:</h4>
<p><code>dependencies</code> or <code>build-dependencies</code> probably couldn't do that.</p>



<a name="218233953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233953">(Nov 29 2020 at 22:29)</a>:</h4>
<p>(At least not without introducing a second copy into the dependency tree.)</p>



<a name="218233965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218233965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218233965">(Nov 29 2020 at 22:29)</a>:</h4>
<p>wait until you see the next bullet ;)</p>



<a name="218234303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234303">(Nov 29 2020 at 22:38)</a>:</h4>
<p>Moving the list to the reference section sounds good, but we should also give an example of depending on a cdylib.</p>



<a name="218234314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234314">(Nov 29 2020 at 22:39)</a>:</h4>
<p>I'm trying to think of use cases for that <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="218234318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234318">(Nov 29 2020 at 22:39)</a>:</h4>
<p>maybe your LD_PRELOAD example</p>



<a name="218234362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234362">(Nov 29 2020 at 22:40)</a>:</h4>
<p>We don't have to give the precise use case in the guide section; we can just show <code>include_bytes!</code>.</p>



<a name="218234381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234381">(Nov 29 2020 at 22:41)</a>:</h4>
<p>Trying to figure out exactly what the environment variable names should be...</p>



<a name="218234407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234407">(Nov 29 2020 at 22:42)</a>:</h4>
<p>oooh you could use this to bundle KLEE or LLVM</p>



<a name="218234435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234435">(Nov 29 2020 at 22:42)</a>:</h4>
<p>actually <code>clang-sys</code> would <em>love</em> this use case I bet</p>



<a name="218234436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234436">(Nov 29 2020 at 22:42)</a>:</h4>
<p>they get <em>so</em> many bug reports about system dependencies lol</p>



<a name="218234440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234440">(Nov 29 2020 at 22:42)</a>:</h4>
<p>I'm very much wondering if it'd be possible for rustc to supply, via the sysroot, <em>the</em> clang and LLVM it built with.</p>



<a name="218234444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234444">(Nov 29 2020 at 22:43)</a>:</h4>
<p>build-depend on that and you get to do cross-language LTO reliably.</p>



<a name="218234448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234448">(Nov 29 2020 at 22:43)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="116122">@simulacrum</span> was discussing that recently</p>



<a name="218234451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234451">(Nov 29 2020 at 22:43)</a>:</h4>
<p>Several people have been for a while, yeah.</p>



<a name="218234452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234452">(Nov 29 2020 at 22:43)</a>:</h4>
<p>This will make it much more usable though.</p>



<a name="218234500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234500">(Nov 29 2020 at 22:44)</a>:</h4>
<p>hmm, I'm not sure what the RFC has to do with clang though - those are already not known to cargo because they're loaded from sysroot</p>



<a name="218234503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234503">(Nov 29 2020 at 22:44)</a>:</h4>
<p>(does cargo set <code>SYSROOT</code> currently?)</p>



<a name="218234515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234515">(Nov 29 2020 at 22:45)</a>:</h4>
<p>looks like no, all I found was <a href="https://doc.rust-lang.org/cargo/reference/environment-variables.html?highlight=sysroot#dynamic-library-paths">https://doc.rust-lang.org/cargo/reference/environment-variables.html?highlight=sysroot#dynamic-library-paths</a></p>



<a name="218234526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234526">(Nov 29 2020 at 22:45)</a>:</h4>
<p>I'm talking about the crates semi-magically supplied by rustc from the sysroot.</p>



<a name="218234528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234528">(Nov 29 2020 at 22:45)</a>:</h4>
<p>But you're right, cargo would have to be more aware of them.</p>



<a name="218234529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234529">(Nov 29 2020 at 22:45)</a>:</h4>
<p>(which would be good for many other reasons, too)</p>



<a name="218234531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234531">(Nov 29 2020 at 22:45)</a>:</h4>
<p>One problem at a time. :)</p>



<a name="218234586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234586">(Nov 29 2020 at 22:47)</a>:</h4>
<p>What do you think of how the cmake example looks now?</p>



<a name="218234637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234637">(Nov 29 2020 at 22:48)</a>:</h4>
<p>looks great :)</p>



<a name="218234649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234649">(Nov 29 2020 at 22:49)</a>:</h4>
<p>I will admit to being tempted to just add an environment variable <code>CARGO_BIN_PATH_CMAKE_cmake</code>.</p>



<a name="218234653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234653">(Nov 29 2020 at 22:49)</a>:</h4>
<p>And then that would include the <code>/cmake</code> or <code>\cmake.exe</code>.</p>



<a name="218234700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234700">(Nov 29 2020 at 22:50)</a>:</h4>
<p>I think that would be great to have :)</p>



<a name="218234702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234702">(Nov 29 2020 at 22:50)</a>:</h4>
<p>Would you object strongly to having both that and <code>CARGO_BIN_DIR_CMAKE</code>?</p>



<a name="218234707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234707">(Nov 29 2020 at 22:50)</a>:</h4>
<p>One potential downside of environment variables as they exist today is there is no way at build time to get OsStr env right now, btw, but that can be tackled separately if we start actively using this sort of thing.</p>



<a name="218234708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234708">(Nov 29 2020 at 22:50)</a>:</h4>
<p>is there a time that <code>DIR_PATH</code> <em>wouldn't</em> be <code>BIN_PATH</code> with the last component removed?</p>



<a name="218234720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234720">(Nov 29 2020 at 22:51)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Probably not, but then you <em>have</em> to name a specific binary and extract the dirname from it.</p>



<a name="218234723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234723">(Nov 29 2020 at 22:51)</a>:</h4>
<p>sure? I'm still a little unsure what the use case for the directory is</p>



<a name="218234725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234725">(Nov 29 2020 at 22:52)</a>:</h4>
<p>Add it to path and call <code>make</code>. :)</p>



<a name="218234764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234764">(Nov 29 2020 at 22:52)</a>:</h4>
<p>ahhhh</p>



<a name="218234765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234765">(Nov 29 2020 at 22:52)</a>:</h4>
<p>And then that might go call <code>clang</code>, for which it needs to be on the <code>$PATH</code>.</p>



<a name="218234773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234773">(Nov 29 2020 at 22:52)</a>:</h4>
<p>so there's an implicit assumption here that cargo puts all bins in the same directory</p>



<a name="218234774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234774">(Nov 29 2020 at 22:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218234707">said</a>:</p>
<blockquote>
<p>One potential downside of environment variables as they exist today is there is no way at build time to get OsStr env right now, btw, but that can be tackled separately if we start actively using this sort of thing.</p>
</blockquote>
<p>Fair point. If you do builds in a directory that's not valid UTF-8 you're probably <em>already</em> encountering pain, but we shouldn't add to that.</p>



<a name="218234778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234778">(Nov 29 2020 at 22:52)</a>:</h4>
<blockquote>
<p>so there's an implicit assumption here that cargo puts all bins in the same directory</p>
</blockquote>
<p>do you plan for that to always be true?</p>



<a name="218234788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234788">(Nov 29 2020 at 22:53)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> FWIW I would not worry about it for this RFC, it's already a problem as I said for RUSTC and CARGO set by Cargo today. I think the solution is probably var_os!() or something like that, similar to how we have std::env::var and std::env::var_os.</p>



<a name="218234789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234789">(Nov 29 2020 at 22:53)</a>:</h4>
<p>Good question. I <em>think</em> that if that were ever not the case, we'd then need to expand this mechanism, to allow for (say) a "root directory" in which you might find <code>bin/</code> and <code>include</code> and <code>lib</code> and similar. :)</p>



<a name="218234832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234832">(Nov 29 2020 at 22:54)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> <code>env_os!</code> presumably, but yeah, I agree.</p>



<a name="218234833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234833">(Nov 29 2020 at 22:54)</a>:</h4>
<p>ah, yeah</p>



<a name="218234898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218234898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218234898">(Nov 29 2020 at 22:56)</a>:</h4>
<p>I added a note towards the bottom of the RFC to that effect.</p>



<a name="218235195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235195">(Nov 29 2020 at 23:05)</a>:</h4>
<p>Here's an interesting twist...</p>



<a name="218235197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235197">(Nov 29 2020 at 23:05)</a>:</h4>
<p>Can you depend on both the binary and library of a crate?</p>



<a name="218235200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235200">(Nov 29 2020 at 23:05)</a>:</h4>
<p><code>type = ["bin", "lib"]</code>?</p>



<a name="218235205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235205">(Nov 29 2020 at 23:05)</a>:</h4>
<p>I would expect you to be able to</p>



<a name="218235207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235207">(Nov 29 2020 at 23:05)</a>:</h4>
<p>the <code>rustc-perf</code> use case in particular would need both</p>



<a name="218235253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235253">(Nov 29 2020 at 23:06)</a>:</h4>
<p>since it runs the <code>rustc</code> shim but also uses the main <code>measureme</code> library</p>



<a name="218235254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235254">(Nov 29 2020 at 23:06)</a>:</h4>
<p>so I guess we should change <code>type</code> to an array then?</p>



<a name="218235258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235258">(Nov 29 2020 at 23:06)</a>:</h4>
<p>Or do you need to write <code>foo-bin = { version = "...", type = "bin",  package = "foo" }</code> and <code>foo = { version = "...", type = "lib" }</code> ?</p>



<a name="218235260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235260">(Nov 29 2020 at 23:06)</a>:</h4>
<p>Would that be easier or harder for Cargo?</p>



<a name="218235265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235265">(Nov 29 2020 at 23:07)</a>:</h4>
<p>I think <code>type</code> could still allow a string, even if it also allows an array of strings.</p>



<a name="218235267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235267">(Nov 29 2020 at 23:07)</a>:</h4>
<p>I think either would be pretty clear personally, with a slight preference for <code>type = []</code> so you don't need to keep the versions in sync</p>



<a name="218235272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235272">(Nov 29 2020 at 23:07)</a>:</h4>
<p>rustbuild and rustc-perf want binary dependencies, but since in both cases they're really self-deps the lib doesn't make sense</p>



<a name="218235273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235273">(Nov 29 2020 at 23:07)</a>:</h4>
<p>you can't self-depend on yourself literally :)</p>



<a name="218235319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235319">(Nov 29 2020 at 23:08)</a>:</h4>
<p>rustc-perf also has the measureme use case, but that's less clear cut: measureme does not bundle the binaries with the library as src/bin/foo.rs but rather they're just separate crates.</p>



<a name="218235325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235325">(Nov 29 2020 at 23:08)</a>:</h4>
<p>I added a note to the guide section.</p>



<a name="218235403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235403">(Nov 29 2020 at 23:11)</a>:</h4>
<p>/me ponders the cdylib and staticlib cases.</p>



<a name="218235412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235412">(Nov 29 2020 at 23:11)</a>:</h4>
<p>I'm trying to figure out if we can cover both cases (with and without <code>_&lt;ARTIFACT&gt;</code>) without having to duplicate the whole bullet.</p>



<a name="218235468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235468">(Nov 29 2020 at 23:12)</a>:</h4>
<p>Checking something...</p>



<a name="218235481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235481">(Nov 29 2020 at 23:13)</a>:</h4>
<p>Oh. Since you <em>can</em> change the name of the library you build, perhaps we don't need to special-case that.</p>



<a name="218235491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235491">(Nov 29 2020 at 23:14)</a>:</h4>
<p>If you have a cdylib crate <code>foo</code> that builds a library with <code>name = "bar"</code> and thus an artifact <code>libbar.so</code>, I think we'd set <code>CARGO_CDYLIB_FILE_FOO_bar</code>.</p>



<a name="218235560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235560">(Nov 29 2020 at 23:15)</a>:</h4>
<p>lowercase <code>bar</code>, right?</p>



<a name="218235562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235562">(Nov 29 2020 at 23:15)</a>:</h4>
<p>Yes. Fixed.</p>



<a name="218235925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218235925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218235925">(Nov 29 2020 at 23:24)</a>:</h4>
<blockquote>
<p><code>type</code> may be a string, or a list of strings; in the latter case, this specifies a dependency on the crate with each of those types. For instance, you may specify a build dependency on both the binary and library of the same crate. You may also specify separate dependencies of different <code>type</code>s; for instance, you may have a build dependency on the binary of a crate and a dependency on the library of the same crate.</p>
</blockquote>
<p>Does that sound reasonable to you?</p>



<a name="218236360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236360">(Nov 29 2020 at 23:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> Regarding self-deps, does <code>CARGO_BIN_EXE_...</code> help there?</p>



<a name="218236369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236369">(Nov 29 2020 at 23:37)</a>:</h4>
<p>It would be enough, but it's not set for the library crate</p>



<a name="218236373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236373">(Nov 29 2020 at 23:37)</a>:</h4>
<p>Ah, got it.</p>



<a name="218236374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236374">(Nov 29 2020 at 23:37)</a>:</h4>
<p>(or anything except tests I think?)</p>



<a name="218236377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236377">(Nov 29 2020 at 23:37)</a>:</h4>
<p>Can you clarify the use case there, then?</p>



<a name="218236378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236378">(Nov 29 2020 at 23:38)</a>:</h4>
<p>What is depending on what artifact of what?</p>



<a name="218236458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236458">(Nov 29 2020 at 23:39)</a>:</h4>
<p>There are two cases. The library crate wants to run the binary crate in one, and the other is that one binary crate wants to run another "sibling" binary crate</p>



<a name="218236540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236540">(Nov 29 2020 at 23:41)</a>:</h4>
<p>In the former case, how is that circular dependency resolved?</p>



<a name="218236549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236549">(Nov 29 2020 at 23:41)</a>:</h4>
<p>It just needs the future path</p>



<a name="218236593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236593">(Nov 29 2020 at 23:42)</a>:</h4>
<p>I don't think this RFC could solve that without a substantially different model.</p>



<a name="218236597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236597">(Nov 29 2020 at 23:42)</a>:</h4>
<p>But in any case it's possible for sibling crate to be the only requirement</p>



<a name="218236598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236598">(Nov 29 2020 at 23:42)</a>:</h4>
<p>Right now, the expectation is that when you're given the path, you can immediately run things with that path.</p>



<a name="218236601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236601">(Nov 29 2020 at 23:42)</a>:</h4>
<p>Just more annoying since you need to thread the value down</p>



<a name="218236618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236618">(Nov 29 2020 at 23:43)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Does this seem reasonable?</p>
<blockquote>
<p>Cargo will unify features across dependencies of all types.</p>
</blockquote>



<a name="218236621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236621">(Nov 29 2020 at 23:43)</a>:</h4>
<p>It also is a little unfortunate that setting an env var like this wouldnt really work for distribution, no?</p>



<a name="218236630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236630">(Nov 29 2020 at 23:44)</a>:</h4>
<p>distribution is out of scope IMO</p>



<a name="218236668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236668">(Nov 29 2020 at 23:44)</a>:</h4>
<p><span class="user-mention" data-user-id="209168">@Thom Chiovoloni</span> You're talking about use cases like having a library available at runtime?</p>



<a name="218236670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236670">(Nov 29 2020 at 23:44)</a>:</h4>
<p>Or a binary, or similar?</p>



<a name="218236672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236672">(Nov 29 2020 at 23:44)</a>:</h4>
<p>if you want, you can <code>include_bytes!</code></p>



<a name="218236678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236678">(Nov 29 2020 at 23:44)</a>:</h4>
<p>I'm talking about use cases outside of <code>cargo run</code></p>



<a name="218236681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236681">(Nov 29 2020 at 23:44)</a>:</h4>
<p>otherwise, cargo has no idea how the binary is getting to the end user</p>



<a name="218236709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236709">(Nov 29 2020 at 23:45)</a>:</h4>
<p>Right, but that means code using this feature would be fragile and won't support being used outside <code>cargo run</code> (unless something emulates what cargo does) which seems unfortunate.</p>



<a name="218236714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236714">(Nov 29 2020 at 23:45)</a>:</h4>
<p>right, you mean something like <a href="https://github.com/jyn514/saltwater/issues/388">https://github.com/jyn514/saltwater/issues/388</a> I think</p>



<a name="218236717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236717">(Nov 29 2020 at 23:45)</a>:</h4>
<p>That's a different use case that this RFC just doesn't cover.</p>



<a name="218236721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236721">(Nov 29 2020 at 23:45)</a>:</h4>
<p>I don't see a solution to this, but it does seem like a problem.</p>



<a name="218236728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236728">(Nov 29 2020 at 23:45)</a>:</h4>
<p>It <em>absolutely</em> is a problem.</p>



<a name="218236742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236742">(Nov 29 2020 at 23:46)</a>:</h4>
<p>It's just a very different problem, and if it's even possible for cargo to solve, the solution would look quite different.</p>



<a name="218236771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236771">(Nov 29 2020 at 23:46)</a>:</h4>
<p>To be clear, the binary dep rustbuild and rustc-perf want are runtime deps - I think the solution here doesn't solve distribution, but it does solve cargo run working</p>



<a name="218236775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236775">(Nov 29 2020 at 23:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218236618">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> Does this seem reasonable?</p>
<blockquote>
<p>Cargo will unify features across dependencies of all types.</p>
</blockquote>
</blockquote>
<p>yeah, that seems fine</p>



<a name="218236782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236782">(Nov 29 2020 at 23:46)</a>:</h4>
<p>or at least, no worse than the current situation for libraries</p>



<a name="218236800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236800">(Nov 29 2020 at 23:47)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> I can imagine, in the future, a <code>unify = false</code> attribute or similar, that would let you say "it's just a binary, I <em>don't care</em> what it wants, isolate it".</p>



<a name="218236805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236805">(Nov 29 2020 at 23:47)</a>:</h4>
<p>But that could happen later.</p>



<a name="218236813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236813">(Nov 29 2020 at 23:47)</a>:</h4>
<p>that would cause rebuilds, right? since the library is built once with and once without the feature?</p>



<a name="218236823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236823">(Nov 29 2020 at 23:47)</a>:</h4>
<p>in general I think features in cargo could use some work :/</p>



<a name="218236827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236827">(Nov 29 2020 at 23:48)</a>:</h4>
<p>Only if you had some other dependency on it.</p>



<a name="218236866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236866">(Nov 29 2020 at 23:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218236823">said</a>:</p>
<blockquote>
<p>in general I think features in cargo could use some work :/</p>
</blockquote>
<p>Yes.</p>



<a name="218236894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236894">(Nov 29 2020 at 23:48)</a>:</h4>
<p>last comment (or I'll split the thread if it goes further :P) - unifying features leads to hidden dependencies: <a href="https://github.com/rust-lang/rustwide/pull/49#issuecomment-725853534">https://github.com/rust-lang/rustwide/pull/49#issuecomment-725853534</a></p>



<a name="218236906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236906">(Nov 29 2020 at 23:49)</a>:</h4>
<p>Yeah, that's a very real possibility.</p>



<a name="218236932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236932">(Nov 29 2020 at 23:50)</a>:</h4>
<p>On the other hand, unifying by default means you could do things like build a library and its helper binary, use the helper binary to build a data structure, <code>include_bytes!</code> that data structure, and use the library to parse that data structure at runtime.</p>



<a name="218236972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218236972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218236972">(Nov 29 2020 at 23:50)</a>:</h4>
<p>And know that the library and binary will match.</p>



<a name="218237059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237059">(Nov 29 2020 at 23:53)</a>:</h4>
<blockquote>
<p>unifying features leads to hidden dependencies:</p>
</blockquote>
<p>cc <a href="https://github.com/rust-lang/rfcs/pull/2957">https://github.com/rust-lang/rfcs/pull/2957</a></p>



<a name="218237121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237121">(Nov 29 2020 at 23:54)</a>:</h4>
<p><span class="user-mention" data-user-id="120179">@Eh2406</span> that seems nice, but doesn't help the use case I linked</p>



<a name="218237124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237124">(Nov 29 2020 at 23:55)</a>:</h4>
<p>it's <em>only</em> for target-specific features</p>



<a name="218237128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237128">(Nov 29 2020 at 23:55)</a>:</h4>
<p>when you know you definitely don't need it</p>



<a name="218237132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237132">(Nov 29 2020 at 23:55)</a>:</h4>
<p>this is 'rustwide needed the dependency, but didn't know it needed it'</p>



<a name="218237138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237138">(Nov 29 2020 at 23:55)</a>:</h4>
<p>also Josh, your checkmark/opinion on that RFC would be appreciated.</p>



<a name="218237178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237178">(Nov 29 2020 at 23:56)</a>:</h4>
<p><span class="user-mention" data-user-id="120179">@Eh2406</span> Ah, thanks for the reminder. Will review after finishing this draft.</p>



<a name="218237201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237201">(Nov 29 2020 at 23:57)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Yes it is not everything but it is a big step forward.</p>



<a name="218237250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237250">(Nov 29 2020 at 23:58)</a>:</h4>
<p>Right, I didn't mean to belittle your efforts, sorry. It does look like a really nice improvement :) maybe it will finally get crates to stop building winapi on Linux lol</p>



<a name="218237262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237262">(Nov 29 2020 at 23:59)</a>:</h4>
<p>Or requiring Fuchsia libraries on non-Fuchsia platforms.</p>



<a name="218237421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237421">(Nov 30 2020 at 00:02)</a>:</h4>
<p>cc <a href="https://github.com/retep998/winapi-rs/pull/949">https://github.com/retep998/winapi-rs/pull/949</a></p>



<a name="218237445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237445">(Nov 30 2020 at 00:03)</a>:</h4>
<p>Other use cases, BTW, would include building a binary for an enclave, such as SGX. Or boot firmware for a virtual machine.</p>



<a name="218237530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237530">(Nov 30 2020 at 00:05)</a>:</h4>
<p>Honestly it is Eric's handiwork. So all credit goes to him. It also paves a trail for how un-unifly things if there are more categories that need that treatment.</p>



<a name="218237599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237599">(Nov 30 2020 at 00:06)</a>:</h4>
<p><span class="user-mention" data-user-id="120179">@Eh2406</span> Makes sense. So, if we wanted to have an opt-out for unification with artifact dependencies, that same mechanism would help with that?</p>



<a name="218237722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237722">(Nov 30 2020 at 00:10)</a>:</h4>
<p>I think so, but <span class="user-mention" data-user-id="120518">@Eric Huss</span> would know better. I more ment that if it is a small impact braking change we have a <code>resolver = "3"</code> as a tool.</p>



<a name="218237829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237829">(Nov 30 2020 at 00:12)</a>:</h4>
<blockquote>
<p>You can obtain the directory containing all binaries built by the cmake crate with CARGO_BIN_PATH_CMAKE, such as to add it to $PATH before invoking another build system or a script.</p>
</blockquote>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> did you mean <code>CARGO_DIR_PATH_CMAKE</code>?</p>



<a name="218237842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237842">(Nov 30 2020 at 00:13)</a>:</h4>
<p>No, though we could certainly change the name.</p>



<a name="218237843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237843">(Nov 30 2020 at 00:13)</a>:</h4>
<p><code>CARGO_&lt;TARGET&gt;_PATH_&lt;CRATE&gt;</code>.</p>



<a name="218237847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237847">(Nov 30 2020 at 00:13)</a>:</h4>
<p>hmm, so how do you tell the directory apart from the binary itself?</p>



<a name="218237852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237852">(Nov 30 2020 at 00:13)</a>:</h4>
<p>I guess binaries have a <code>_&lt;bin&gt;</code> suffix</p>



<a name="218237856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237856">(Nov 30 2020 at 00:13)</a>:</h4>
<p>I thought that's not true of the other artifacts though?</p>



<a name="218237857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237857">(Nov 30 2020 at 00:13)</a>:</h4>
<p>The individual files are <code>CARGO_&lt;TARGET&gt;_FILE_&lt;CRATE&gt;</code>.</p>



<a name="218237900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237900">(Nov 30 2020 at 00:14)</a>:</h4>
<p>(Also, typo, I meant <code>DIR</code> rather than <code>PATH</code>.)</p>



<a name="218237902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237902">(Nov 30 2020 at 00:14)</a>:</h4>
<p>ah ok, I missed that it's <code>DIR</code> as the 3rd component</p>



<a name="218237914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237914">(Nov 30 2020 at 00:14)</a>:</h4>
<p>It can definitely help if we need to have some way for <code>features</code> to not unificatify, If we want to go further and allow <code>foo=1.0.1</code> to be in the tree of the project and <code>foo=1.0.3</code> to in the tree of the binary, then we will need to do something more radical.</p>



<a name="218237919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237919">(Nov 30 2020 at 00:15)</a>:</h4>
<p>Changed it to consistently use <code>CARGO_&lt;TARGET&gt;_DIR_&lt;CRATE&gt;</code> everywhere for the directory, and <code>CARGO_&lt;TARGET&gt;_FILE_&lt;CRATE&gt;_&lt;ARTIFACT&gt;</code> for the files.</p>



<a name="218237933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237933">(Nov 30 2020 at 00:15)</a>:</h4>
<blockquote>
<p>Note that cargo cannot help you ensure these artifacts are available at runtime for your binary; cargo can only supply these artifacts at build time.</p>
</blockquote>
<p>Should this instead say 'artifacts at runtime aren't in scope for the RFC'? Right now it sounds like it's saying it will <em>never</em> be in scope</p>



<a name="218237935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237935">(Nov 30 2020 at 00:15)</a>:</h4>
<p>I remember avoiding <code>_PATH_</code> because it's ambiguous; I meant it like <code>$PATH</code>, but both files and directories have paths.</p>



<a name="218237984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237984">(Nov 30 2020 at 00:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218237933">said</a>:</p>
<blockquote>
<blockquote>
<p>Note that cargo cannot help you ensure these artifacts are available at runtime for your binary; cargo can only supply these artifacts at build time.</p>
</blockquote>
<p>Should this instead say 'artifacts at runtime aren't in scope for the RFC'? Right now it sounds like it's saying it will <em>never</em> be in scope</p>
</blockquote>
<p>I didn't intend it to sound like "never", but I strongly suspect "never" is the answer so I can imagine some of that showed through. ;)</p>



<a name="218237990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218237990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218237990">(Nov 30 2020 at 00:16)</a>:</h4>
<p>I'll modify that.</p>



<a name="218238004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238004">(Nov 30 2020 at 00:16)</a>:</h4>
<p>(Note that it's guide-level documentation for a feature, though, so "what's possible in the future" is not technically in scope for the documentation.)</p>



<a name="218238008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238008">(Nov 30 2020 at 00:17)</a>:</h4>
<p>oh that's funny, I thought you were in favor of <a href="https://github.com/rust-lang/cargo/issues/2729">https://github.com/rust-lang/cargo/issues/2729</a></p>



<a name="218238022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238022">(Nov 30 2020 at 00:17)</a>:</h4>
<p>I'm completely in favor of that and similar proposals, but those are only for the case where Cargo is responsible for doing the installation.</p>



<a name="218238026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238026">(Nov 30 2020 at 00:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218238004">said</a>:</p>
<blockquote>
<p>(Note that it's guide-level documentation for a feature, though, so "what's possible in the future" is not technically in scope for the documentation.)</p>
</blockquote>
<p>right, it's not definitive for sure, but best to avoid giving the impression that it is</p>



<a name="218238035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238035">(Nov 30 2020 at 00:17)</a>:</h4>
<p>ahhh I see, <em>only</em> for the <code>cargo install</code> use case and nothing else</p>



<a name="218238044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238044">(Nov 30 2020 at 00:18)</a>:</h4>
<p>Cargo can't <em>ensure</em> the artifacts are available. It could install them, but then they might still not be available if (say) someone removes them, or a packager doesn't install them.</p>



<a name="218238082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238082">(Nov 30 2020 at 00:18)</a>:</h4>
<p>yeah that seems reasonable</p>



<a name="218238086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238086">(Nov 30 2020 at 00:18)</a>:</h4>
<p>Or if they're split into a different distro package that isn't installed...</p>



<a name="218238129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238129">(Nov 30 2020 at 00:19)</a>:</h4>
<blockquote>
<ol start="2">
<li><code>"bin"</code>, a binary crate (and all the binaries it builds, by default)</li>
</ol>
</blockquote>
<p>hmm, this seems confusing but I'm not sure how to reword it</p>



<a name="218238131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238131">(Nov 30 2020 at 00:19)</a>:</h4>
<p>maybe 'a package with at least one binary'?</p>



<a name="218238197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238197">(Nov 30 2020 at 00:20)</a>:</h4>
<p>How's that?</p>



<a name="218238210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238210">(Nov 30 2020 at 00:21)</a>:</h4>
<p>much less confusing, although I do think 'package' is less ambiguous than 'crate'. but maybe people are more familiar with 'crate'?</p>



<a name="218238221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238221">(Nov 30 2020 at 00:21)</a>:</h4>
<p>People are <em>much</em> more familiar with "crate" I think.</p>



<a name="218238228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238228">(Nov 30 2020 at 00:21)</a>:</h4>
<p>And I don't think in this case the distinction causes an issue.</p>



<a name="218238285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238285">(Nov 30 2020 at 00:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218238221">said</a>:</p>
<blockquote>
<p>People are <em>much</em> more familiar with "crate" I think.</p>
</blockquote>
<p>I have proof of this actually - someone was planning to split a package into workspaces because they didn't realize they could have multiple binaries <a href="https://github.com/deadlinks/cargo-deadlinks/issues/47#issuecomment-475566521">https://github.com/deadlinks/cargo-deadlinks/issues/47#issuecomment-475566521</a></p>



<a name="218238288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238288">(Nov 30 2020 at 00:23)</a>:</h4>
<p>There's one other thing that I think needs to be specified, and I'm really not looking forward to it...</p>



<a name="218238293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238293">(Nov 30 2020 at 00:23)</a>:</h4>
<p>We need to specify how this interacts with the index.</p>



<a name="218238340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238340">(Nov 30 2020 at 00:24)</a>:</h4>
<p>If we just include the <code>type</code> field in the index, would old versions of cargo choke and die on that?</p>



<a name="218238346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238346">(Nov 30 2020 at 00:24)</a>:</h4>
<p>is there no way to add new metadata to the index without breaking old cargo versions?</p>



<a name="218238348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238348">(Nov 30 2020 at 00:24)</a>:</h4>
<p>Very, <em>very</em> carefully.</p>



<a name="218238360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238360">(Nov 30 2020 at 00:25)</a>:</h4>
<p>Obviously, old <code>cargo</code> would break if the dependency pulls in a newer crate that uses this feature (which is what it should do), but the question then becomes, would old <code>cargo</code> choke if it pulls in an existing crate for which later versions use this feature?</p>



<a name="218238406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238406">(Nov 30 2020 at 00:26)</a>:</h4>
<p>because all the versions are stored in the same file in the index?</p>



<a name="218238408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238408">(Nov 30 2020 at 00:26)</a>:</h4>
<p>Right.</p>



<a name="218238410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238410">(Nov 30 2020 at 00:26)</a>:</h4>
<p>(Which is probably the first thing we should fix if we ever rev the index format.)</p>



<a name="218238425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238425">(Nov 30 2020 at 00:27)</a>:</h4>
<p>Question:<br>
let's say I have a dependency like <code>foo= { version = "&lt;3.0.0", type = "bin" }</code>but the binary was only in <code>&lt;1.0.0</code>. Does the resolver have to bactrack until it finds a version that has a "bin" or can it give you the most recent version and let the build fail latter? This may be the question that Josh just came up with...</p>



<a name="218238472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238472">(Nov 30 2020 at 00:28)</a>:</h4>
<p>I would expect that to let the build fail</p>



<a name="218238474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238474">(Nov 30 2020 at 00:28)</a>:</h4>
<p>That isn't quite the same question, and I'd be happy with the simpler answer: resolve versions without regard to type, then if the type isn't available, die.</p>



<a name="218238483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238483">(Nov 30 2020 at 00:28)</a>:</h4>
<p>that also avoids confusion where you suddenly bump a major version because the new version now supports <code>"bin"</code></p>



<a name="218238485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238485">(Nov 30 2020 at 00:29)</a>:</h4>
<p>Removing a type is a semver-incompatible change. Adding one is backwards-compatible.</p>



<a name="218238495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238495">(Nov 30 2020 at 00:29)</a>:</h4>
<p>(although I guess the answer to that is "don't say you support versions you don't")</p>



<a name="218238539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238539">(Nov 30 2020 at 00:30)</a>:</h4>
<blockquote>
<p>Note that &lt;ARTIFACT&gt; is not modified in any way from the name specified in the crate supplying the artifact, or the crate name if not specified; for instance, it may be in lowercase, or contain dashes.</p>
</blockquote>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> doesn't that mean it might not be a valid shell variable?</p>



<a name="218238550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238550">(Nov 30 2020 at 00:30)</a>:</h4>
<p>If your binary has a weird name, it might not be, yes.</p>



<a name="218238552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238552">(Nov 30 2020 at 00:30)</a>:</h4>
<div class="codehilite"><pre><span></span><code>$  export X-Y=1
bash: export: `X-Y=1&#39;: not a valid identifier
</code></pre></div>



<a name="218238570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238570">(Nov 30 2020 at 00:31)</a>:</h4>
<p>We already had this same issue arise with <code>CARGO_BIN_EXE_&lt;name&gt;</code>.</p>



<a name="218238571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238571">(Nov 30 2020 at 00:31)</a>:</h4>
<p>well, then how can cargo set it as an env variable?</p>



<a name="218238573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238573">(Nov 30 2020 at 00:31)</a>:</h4>
<p>oh I see, there's precedent</p>



<a name="218238575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238575">(Nov 30 2020 at 00:31)</a>:</h4>
<p>that's unfortunate</p>



<a name="218238576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238576">(Nov 30 2020 at 00:31)</a>:</h4>
<blockquote>
<p><code>CARGO_BIN_EXE_&lt;name&gt;</code> — The absolute path to a binary target's executable. This is only set when building an integration test or benchmark. This may be used with the env macro to find the executable to run for testing purposes. The &lt;name&gt; is the name of the binary target, exactly as-is. For example, CARGO_BIN_EXE_my-program for a binary named my-program.</p>
</blockquote>



<a name="218238614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238614">(Nov 30 2020 at 00:32)</a>:</h4>
<p>The shell's limitations are not UNIX limitations.</p>



<a name="218238616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238616">(Nov 30 2020 at 00:32)</a>:</h4>
<p>The only requirement for an environment variable name is "does not contain NUL or <code>=</code>".</p>



<a name="218238619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238619">(Nov 30 2020 at 00:32)</a>:</h4>
<p>ah hmm</p>



<a name="218238621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238621">(Nov 30 2020 at 00:32)</a>:</h4>
<p>TIL</p>



<a name="218238625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238625">(Nov 30 2020 at 00:32)</a>:</h4>
<p>So if the resolver does not need to know, then the index only needs to record the new kind of dependency. Witch should make old Cargos ignore the version, as we want.</p>



<a name="218238651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238651">(Nov 30 2020 at 00:33)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span></p>
<div class="codehilite"><pre><span></span><code>$ env -i &#39;foo bar-baz=value&#39; env
foo bar-baz=value
</code></pre></div>



<a name="218238692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238692">(Nov 30 2020 at 00:34)</a>:</h4>
<div class="codehilite"><pre><span></span><code>$ env -i &#39;/a/b/c=value&#39; env
/a/b/c=value
</code></pre></div>



<a name="218238696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238696">(Nov 30 2020 at 00:34)</a>:</h4>
<p>TIL you can call env recursively <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218238718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238718">(Nov 30 2020 at 00:35)</a>:</h4>
<p>And just to show it works with other things:</p>
<div class="codehilite"><pre><span></span><code>$ env -i &#39;a-b c=value&#39; python3 -c &#39;import os;print(os.getenv(&quot;a-b c&quot;))&#39;
value
</code></pre></div>



<a name="218238788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238788">(Nov 30 2020 at 00:37)</a>:</h4>
<p>It seems reasonable to canonicalize crate names, because we place more requirements on those.</p>



<a name="218238840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218238840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218238840">(Nov 30 2020 at 00:38)</a>:</h4>
<p>Though if we start allowing <code>a/b</code> as a crate name (cc <span class="user-mention" data-user-id="132040">@Manish Goregaokar</span>) then we'll need a mapping scheme for the corresponding cargo environment variables.</p>



<a name="218239036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239036">(Nov 30 2020 at 00:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F/near/218238625">said</a>:</p>
<blockquote>
<p>So if the resolver does not need to know, then the index only needs to record the new kind of dependency. Witch should make old Cargos ignore the version, as we want.</p>
</blockquote>
<p>Can you elaborate on that a bit?</p>



<a name="218239043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239043">(Nov 30 2020 at 00:43)</a>:</h4>
<p>If we add the <code>type</code> field to a dependency, what makes older Cargo ignore that rather than dying?</p>



<a name="218239187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239187">(Nov 30 2020 at 00:47)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> To answer the question you posed in a comment, I think <code>setup.py</code> isn't a great example (would be better if this came up in its notion of dependencies), but I think <code>make</code> is.</p>



<a name="218239231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239231">(Nov 30 2020 at 00:48)</a>:</h4>
<p>right, because setup.py doesn't deal with binaries at all</p>



<a name="218239232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239232">(Nov 30 2020 at 00:48)</a>:</h4>
<p>makes sense</p>



<a name="218239246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239246">(Nov 30 2020 at 00:48)</a>:</h4>
<p>I need to get going for a little while, but I'd be up for continuing this later, and hopefully posting this this week.</p>



<a name="218239259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239259">(Nov 30 2020 at 00:49)</a>:</h4>
<p>Cargo ignores things in the index that it doesn't understand. Depending on how we encode it:<br>
If we add a field to a dependency, it will read the row and treat the dependay like a normal one, so it won't fail in the resolver.<br>
If we add a new kind of dependency, it will realize that it has no idea what new cargo is talking about and skipp the entire version.</p>



<a name="218239274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239274">(Nov 30 2020 at 00:50)</a>:</h4>
<p>did we ever decide if this would be available to build scripts when listed in <code>[dependencies]</code>?</p>



<a name="218239316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239316">(Nov 30 2020 at 00:50)</a>:</h4>
<p><span class="user-mention" data-user-id="120179">@Eh2406</span> Interesting. That's helpful.</p>



<a name="218239351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239351">(Nov 30 2020 at 00:51)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> I think we went the <code>target</code> route and decided on "no". If we want it to be, we'd need to spec how that works, more in the style of the <code>DEP_...</code> environment variables.</p>



<a name="218239365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239365">(Nov 30 2020 at 00:51)</a>:</h4>
<p>The spec text I wrote for what bits of the build system have it available doesn't currently allow the build script to access these environment variables for anything other than <code>[build-dependencies]</code>.</p>



<a name="218239637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239637">(Nov 30 2020 at 00:59)</a>:</h4>
<p>I'm not sure if I misunderstood, but the rustc-perf and rustbuild use cases require runtime availability of the binary dependencies, though neither needs anything more than the filepath being provided (and it is fine for things to break when the crate is cargo installed)</p>



<a name="218239710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239710">(Nov 30 2020 at 01:00)</a>:</h4>
<p>I think by 'runtime' <span class="user-mention" data-user-id="239881">@Josh Triplett</span> meant 'after being installed'</p>



<a name="218239714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239714">(Nov 30 2020 at 01:00)</a>:</h4>
<p>so if the paths are the same at build time and runtime it should be fine</p>



<a name="218239793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218239793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218239793">(Nov 30 2020 at 01:03)</a>:</h4>
<p>Ok, I think I would designate installation as a third category and I agree it is a separate and out of scope use case.</p>



<a name="218244801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218244801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218244801">(Nov 30 2020 at 03:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> That sounds reasonable to me. I've updated that line of the RFC to clarify.</p>



<a name="218245668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218245668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218245668">(Nov 30 2020 at 03:40)</a>:</h4>
<p>I added the following note, on the basis that I can't think of <em>any</em> use cases for a <code>[dependencies]</code> entry with <code>target = "host"</code>:</p>
<blockquote>
<p>We could specify a <code>target = "host"</code> value to build for the host even for <code>[dependencies]</code> or <code>[dev-dependencies]</code> which would normally default to the target. If any use case arises for such a dependency, we can easily add that.</p>
</blockquote>



<a name="218245705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218245705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218245705">(Nov 30 2020 at 03:41)</a>:</h4>
<p>In theory you could be using a proc-macro to process the binary, and that proc macro could run the binary. But at that point, why not just use a build dependency?</p>



<a name="218248944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218248944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218248944">(Nov 30 2020 at 04:55)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> I think this may be done and ready to submit. Thoughts?</p>



<a name="218248947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218248947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218248947">(Nov 30 2020 at 04:55)</a>:</h4>
<p>I just finished one last editing pass.</p>



<a name="218249526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218249526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218249526">(Nov 30 2020 at 05:11)</a>:</h4>
<p>I'll take a glance tomorrow but my last impression was that it looked good :)</p>



<a name="218250051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218250051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218250051">(Nov 30 2020 at 05:25)</a>:</h4>
<p>If you review and decide you don't think it needs further changes, go ahead and push. If you do so by Tuesday, the Cargo team can discuss it in the next meeting.</p>



<a name="218359512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218359512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218359512">(Nov 30 2020 at 23:09)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> looks great, opening a PR now</p>



<a name="218359895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218359895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218359895">(Nov 30 2020 at 23:14)</a>:</h4>
<p>can you add a <code>cargo</code> label? <a href="https://github.com/rust-lang/rfcs/pull/3028">https://github.com/rust-lang/rfcs/pull/3028</a></p>



<a name="218386108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Depend%20on%20a%20binary%3F/near/218386108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Depend.20on.20a.20binary.3F.html#218386108">(Dec 01 2020 at 06:58)</a>:</h4>
<p>Done, and nominated for tomorrow's meeting.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>